package com.atguigu.aiproject.websocket.entity;
import com.atguigu.aiproject.entity.ChatMessage;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import java.time.LocalDateTime;

@Data
public class WebSocketMessage {
    //用于实时通信，通过type代表不同的消息类型

    private String type; // MESSAGE, READ, TYPING, ONLINE_STATUS
    private ChatMessage message;
    private Integer senderId;
    private Integer receiverId;
    private Long messageId;
    private Boolean isOnline;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime timestamp;
}